Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgresql 11 role #449

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Postgresql 11 role #449

wants to merge 18 commits into from

Conversation

FedericoCeratto
Copy link
Contributor

No description provided.

@FedericoCeratto FedericoCeratto requested a review from hellais June 26, 2020 11:03
@FedericoCeratto FedericoCeratto changed the base branch from master to certbot-377 June 26, 2020 11:03

- name: Clean cache
apt:
autoclean: yes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should be adding in here also the creation of the accounts, like what dom0 is doing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bootstrap is quite different from dom0, maybe we can deploy new nodes with these new roles over the next months before starting to backport stuff (due to the risk of breaking live nodes).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So currently to deploy this, you would still have to run the dom0 bootstrap playbook on it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to create users

- /dev/xvde1
- /dev/xvdf1
- /dev/xvdg1
- /dev/xvdh1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, since these are about the specific disk setup of the particular ams-pg host, these should go outside of the postgresql11 role?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Active and standby DB hosts are pretty critical. I think it's safer to dedicate a role for a specific host (instead of having variables and conditionals that can cause unexpected changes on a host A while we are changing host B).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, perhaps then the role name should contain the active/standby role in it?

Copy link
Member

@hellais hellais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did another pass at reviewing. Let me know with inline comments if there are specific areas I should be focusing on.


- name: configure netdata nginx
blockinfile:
path: /etc/netdata/python.d/chrony.conf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a typo, or is it normal that it’s writing to the same file?

name: nftables.service
state: reloaded

- name: configure netdata.service
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to use blockinfile instead of file or template?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better readability: we can scan through the task file and see what is being done.

@@ -0,0 +1,4 @@
---
dependencies:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the key here is that the role itself will specify the dependencies for other roles, correct?
I think this a reasonable approach, though we should probably document this architecture/pattern somewhere as it might not be immediately obvious this is how roles should be written from now on.

@@ -51,7 +51,7 @@ scrape_configs:
module: [{{ bbjob.module }}]
static_configs:
- targets:
{% for target in bbjob.targets %}
{% for target in (bbjob.targets|sort) %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was the sort added to make the diff more deterministic? I am surprised that ansible did not do it automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes the first, no to the latter: the diff was random every time

format: [prometheus]
static_configs:
- targets:
- ams-pg.ooni.nu:9187
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between these two netadata endpoints and the ones that have_netdata?

@@ -0,0 +1,8 @@
---
dependencies:
- role: track_etc_directory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is a bit too much indirection? Can we put the content of this in the role directly for the time being and abstract it when N > 1 roles need to depend on this and not the base one?

Copy link
Contributor Author

@FedericoCeratto FedericoCeratto Jul 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

base-buster and letsencrypt already both depend on it (and don't depend on each other)

@@ -0,0 +1,101 @@

# Managed by ansible
# roles/nginx-buster/templates/nginx.conf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this role being included?

Base automatically changed from certbot-377 to master July 7, 2020 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants